//
//  AssociatedWithIViewController.h
//  安好
//
//  Created by rlp on 14-12-17.
//  Copyright (c) 2014年 lianchuangbrother. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "AssociatedWithIViewTableViewCell.h"
#import "SystemMessageCenter.h"
#import "NoticeData.h"
#import "NotificationPmlistDataModels.h"
#import "SquarePostsDetailsViewController.h"
#import "XHZoomDrawerView.h"



//键盘// Model
#import "XHMessage.h"
#import "XHStoreManager.h"

// Views
#import "XHMessageTableView.h"
#import "XHMessageTableViewCell.h"
#import "XHMessageInputView.h"
#import "XHShareMenuView.h"
#import "XHEmotionManagerView.h"
#import "XHVoiceRecordHUD.h"

// Factory
#import "XHMessageBubbleFactory.h"
#import "XHMessageVideoConverPhotoFactory.h"

// Helper
#import "XHPhotographyHelper.h"
#import "XHLocationHelper.h"
#import "XHVoiceRecordHelper.h"

// Categorys
#import "UIScrollView+XHkeyboardControl.h"

#import "PopoverView.h"

@protocol XHMessageTableViewControllerDelegate <NSObject>

@optional


/**
 *  协议回掉是否支持用户手动滚动
 *
 *  @return 返回YES or NO
 */
- (BOOL)shouldPreventScrollToBottomWhileUserScrolling;

/**
 *  判断是否支持下拉加载更多消息
 *
 *  @return 返回BOOL值，判定是否拥有这个功能
 */
- (BOOL)shouldLoadMoreMessagesScrollToTop;

/**
 *  下拉加载更多消息，只有在支持下拉加载更多消息的情况下才会调用。
 */
- (void)loadMoreMessagesScrollTotop;

@end

@protocol XHMessageTableViewControllerDataSource <NSObject>

@required

@end
//键盘

@interface AssociatedWithIViewController : BaseViewController<UITableViewDelegate,UITableViewDataSource,UIActionSheetDelegate,XHMessageTableViewControllerDelegate, XHMessageInputViewDelegate, XHMessageTableViewCellDelegate, XHShareMenuViewDelegate, XHEmotionManagerViewDelegate, XHEmotionManagerViewDataSource,UIAlertViewDelegate>
@property(nonatomic,strong)UITableView *tableView;
@property(nonatomic,strong)NSMutableArray *noticeDataArray;
@property(nonatomic,assign)NSInteger page;
@property(nonatomic,strong)NotificationPmlistBaseClass *notificationPmlistBaseClass;
@property(nonatomic,assign)NSInteger index;
@property(nonatomic,assign)NSInteger inIndex;
@property(nonatomic,strong)XHZoomDrawerView *xhZoomDrawerView;


@property (nonatomic,strong)NSString *upid;
@property (nonatomic,strong)NSString *recvuid;
@property (nonatomic,strong)NSString *pid;





/**
 *  键盘
 */
@property (nonatomic, weak) id <XHMessageTableViewControllerDelegate> delegate;

@property (nonatomic, weak) id <XHMessageTableViewControllerDataSource> dataSource;




/**
 *  用于显示发送消息类型控制的工具条，在底部
 */
@property (nonatomic, weak, readonly) XHMessageInputView *messageInputView;

/**
 *  替换键盘的位置的第三方功能控件
 */
@property (nonatomic, weak, readonly) XHShareMenuView *shareMenuView;


/**
 *  管理第三方gif表情的控件
 */
@property (nonatomic, weak, readonly) XHEmotionManagerView *emotionManagerView;

/**
 *  是否正在加载更多旧的消息数据
 */
@property (nonatomic, assign) BOOL loadingMoreMessage;

#pragma mark - Message View Controller Default stup
/**
 *  是否允许手势关闭键盘，默认是允许
 */
@property (nonatomic, assign) BOOL allowsPanToDismissKeyboard; // default is YES


/**
 *  是否允许自定义
 */
@property (nonatomic, assign) BOOL leftDiyViewButton; // default is YES


/**
 *  发送按钮
 */
@property (nonatomic, assign) BOOL rightDiyViewButton; // default is YES
/**
 *  是否允许发送语音
 */
@property (nonatomic, assign) BOOL allowsSendVoice; // default is YES

/**
 *  是否允许发送多媒体
 */
@property (nonatomic, assign) BOOL allowsSendMultiMedia; // default is YES

/**
 *  是否支持发送表情
 */
@property (nonatomic, assign) BOOL allowsSendFace; // default is YES

/**
 *  输入框的样式，默认为扁平化
 */
@property (nonatomic, assign) XHMessageInputViewStyle inputViewStyle;

#pragma mark - DataSource Change






#pragma mark - Messages view controller
/**
 *  完成发送消息的函数
 */
- (void)finishSendMessageWithBubbleMessageType:(XHBubbleMessageMediaType)mediaType;

/**
 *  设置View、tableView的背景颜色
 *
 *  @param color 背景颜色
 */
- (void)setBackgroundColor:(UIColor *)color;

/**
 *  设置消息列表的背景图片
 *
 *  @param backgroundImage 目标背景图片
 */
- (void)setBackgroundImage:(UIImage *)backgroundImage;

/**
 *  是否滚动到底部
 *
 *  @param animated YES Or NO
 */
- (void)scrollToBottomAnimated:(BOOL)animated;

/**
 *  滚动到哪一行
 *
 *  @param indexPath 目标行数变量
 *  @param position  UITableViewScrollPosition 整形常亮
 *  @param animated  是否滚动动画，YES or NO
 */
- (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath
              atScrollPosition:(UITableViewScrollPosition)position
                      animated:(BOOL)animated;



@end
